package com.taobao.api.request;

import java.util.List;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import com.taobao.api.TaobaoObject;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.json.JSONWriter;
import com.taobao.api.response.TmallNrInventoryInitialResponse;

/**
 * TOP API: tmall.nr.inventory.initial request
 * 
 * @author top auto create
 * @since 1.0, 2018.07.25
 */
public class TmallNrInventoryInitialRequest extends BaseTaobaoRequest<TmallNrInventoryInitialResponse> {
	
	

	/** 
	* 请求入参
	 */
	private String param0;

	public void setParam0(String param0) {
		this.param0 = param0;
	}

	public void setParam0(NrStoreInvItemInitialReqDto param0) {
		this.param0 = new JSONWriter(false,true).write(param0);
	}

	public String getParam0() {
		return this.param0;
	}

	public String getApiMethodName() {
		return "tmall.nr.inventory.initial";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("param0", this.param0);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<TmallNrInventoryInitialResponse> getResponseClass() {
		return TmallNrInventoryInitialResponse.class;
	}

	public void check() throws ApiRuleException {
	}
	
	/**
 * 门店商品，最大列表长度：20
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class StoreInvetoryDto extends TaobaoObject {

	private static final long serialVersionUID = 8795671283948146867L;

	/**
		 * 单据流水号，用于幂等操作
		 */
		@ApiField("bill_num")
		private String billNum;
		/**
		 * CERTAINTY 表示确定性库存
		 */
		@ApiField("inventory_type")
		private String inventoryType;
		/**
		 * 天猫商品id
		 */
		@ApiField("item_id")
		private Long itemId;
		/**
		 * 商家的外部商品编码，写入值。
		 */
		@ApiField("outer_id")
		private String outerId;
		/**
		 * 库存数量
		 */
		@ApiField("quantity")
		private Long quantity;
		/**
		 * 天猫后端商品id
		 */
		@ApiField("sc_item_id")
		private Long scItemId;
		/**
		 * sku号
		 */
		@ApiField("sku_id")
		private Long skuId;
	

	public String getBillNum() {
			return this.billNum;
		}
		public void setBillNum(String billNum) {
			this.billNum = billNum;
		}
		public String getInventoryType() {
			return this.inventoryType;
		}
		public void setInventoryType(String inventoryType) {
			this.inventoryType = inventoryType;
		}
		public Long getItemId() {
			return this.itemId;
		}
		public void setItemId(Long itemId) {
			this.itemId = itemId;
		}
		public String getOuterId() {
			return this.outerId;
		}
		public void setOuterId(String outerId) {
			this.outerId = outerId;
		}
		public Long getQuantity() {
			return this.quantity;
		}
		public void setQuantity(Long quantity) {
			this.quantity = quantity;
		}
		public Long getScItemId() {
			return this.scItemId;
		}
		public void setScItemId(Long scItemId) {
			this.scItemId = scItemId;
		}
		public Long getSkuId() {
			return this.skuId;
		}
		public void setSkuId(Long skuId) {
			this.skuId = skuId;
		}

}

	/**
 * 门店信息
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class StoreDto extends TaobaoObject {

	private static final long serialVersionUID = 3597741222896673448L;

	/**
		 * 门店商品，最大列表长度：20
		 */
		@ApiListField("store_inventories")
		@ApiField("store_invetory_dto")
		private List<StoreInvetoryDto> storeInventories;
		/**
		 * 门店对应的storeID值
		 */
		@ApiField("warehouse_id")
		private String warehouseId;
		/**
		 * 库存来源的类型；STORE表示门店
		 */
		@ApiField("warehouse_type")
		private String warehouseType;
	

	public List<StoreInvetoryDto> getStoreInventories() {
			return this.storeInventories;
		}
		public void setStoreInventories(List<StoreInvetoryDto> storeInventories) {
			this.storeInventories = storeInventories;
		}
		public String getWarehouseId() {
			return this.warehouseId;
		}
		public void setWarehouseId(String warehouseId) {
			this.warehouseId = warehouseId;
		}
		public String getWarehouseType() {
			return this.warehouseType;
		}
		public void setWarehouseType(String warehouseType) {
			this.warehouseType = warehouseType;
		}

}

	/**
 * 请求入参
 *
 * @author top auto create
 * @since 1.0, null
 */
public static class NrStoreInvItemInitialReqDto extends TaobaoObject {

	private static final long serialVersionUID = 4425824585217122729L;

	/**
		 * 操作时间
		 */
		@ApiField("operation_time")
		private String operationTime;
		/**
		 * 操作者
		 */
		@ApiField("operator")
		private String operator;
		/**
		 * 门店信息
		 */
		@ApiListField("stores")
		@ApiField("store_dto")
		private List<StoreDto> stores;
		/**
		 * 如果是品牌商家填写商家的sellerID，如果是零售商需要填写品牌商的sellerID，但是需要平台授权；
		 */
		@ApiField("user_id")
		private Long userId;
	

	public String getOperationTime() {
			return this.operationTime;
		}
		public void setOperationTime(String operationTime) {
			this.operationTime = operationTime;
		}
		public String getOperator() {
			return this.operator;
		}
		public void setOperator(String operator) {
			this.operator = operator;
		}
		public List<StoreDto> getStores() {
			return this.stores;
		}
		public void setStores(List<StoreDto> stores) {
			this.stores = stores;
		}
		public Long getUserId() {
			return this.userId;
		}
		public void setUserId(Long userId) {
			this.userId = userId;
		}

}


}